//
//  HotSearchWithRequestTableViewCell.m
//  WULIHH
//
//  Created by tang on 16/4/11.
//  Copyright © 2016年 tang. All rights reserved.
//

#import "HotSearchWithRequestTableViewCell.h"
#import "Header.h"

#import "UIImageView+AFNetworking.h"

@interface HotSearchWithRequestTableViewCell ()
{
    UIImageView *imageView;
    UILabel *titLable;
    UILabel *detalLable;
    
    
    UILabel *liulanLable;
    UILabel *pinglunLable;
}

@end


@implementation HotSearchWithRequestTableViewCell


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self initUI];
        
    }
    return self;
}





- (void)initUI
{
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WithView, 0.5f)];
    [lineView setBackgroundColor:uicolor(193, 193, 193)];
    [self addSubview:lineView];
    
    imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 8, 90, 57)];
//    [imageView setBackgroundColor:[UIColor redColor]];
    [self addSubview:imageView];
    
    titLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView.frame)+9, imageView.frame.origin.y, WithView-CGRectGetMaxX(imageView.frame)+9.0, 15.0)];
    [titLable setTextColor:uicolor(27, 27, 27)];
    [self addSubview:titLable];
    
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView.frame)+9, CGRectGetMaxY(titLable.frame)+8.0, WithView-CGRectGetMaxX(imageView.frame)+9.0, 15.0)];
    [self addSubview:lable];
    [lable setText:@"关联明星"];
    [lable setFont:[UIFont systemFontOfSize:10.0]];
    [lable setTextColor:uicolor(102, 102, 102)];
    
    detalLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView.frame)+9, CGRectGetMaxY(titLable.frame)+8.0, 100.0, 11.0)];
    [self addSubview:detalLable];
    
    liulanLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView.frame)+9, CGRectGetMaxY(lable.frame)+2.0, 70, 15.0)];
    [liulanLable setFont:[UIFont systemFontOfSize:9.0]];
    [liulanLable setTextColor:uicolor(102, 102, 102)];
    [self addSubview:liulanLable];
    
    pinglunLable = [[UILabel alloc] initWithFrame:CGRectMake(100.0+CGRectGetMaxX(imageView.frame), CGRectGetMaxY(lable.frame)+2.0, 70, 15.0)];
    [pinglunLable setTextColor:uicolor(102, 102, 102)];
    [pinglunLable setFont:[UIFont systemFontOfSize:9.0]];
    [self addSubview:pinglunLable];

}




- (void)setmodelWithInfo:(NSDictionary *)dic
{
//    NSLog(@"%@", dic);
    [imageView setImageWithURL:[NSURL URLWithString:[dic valueForKey:@"imageUrl"]]];
    [titLable setText:[dic valueForKey:@"title"]];
    [liulanLable setText:[NSString stringWithFormat:@"浏览：%d", [[dic valueForKey:@"viewCount"] intValue]]];
    [pinglunLable setText:[NSString stringWithFormat:@"评论：%d", [[dic valueForKey:@"commentCount"] intValue]]];
}





- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
